package gameFrame;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;

import CMD.RefreshCMD;

public class OutFrame extends JFrame{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2410253179609465794L;
	
	
	private static OutFrame of = new OutFrame();
	public static OutFrame getOutFrame()
	{
		return of;
	}
	public OutFrame()
	{
		initial();
		this.setLayout(null);
	}
	private void initial()
	{
		this.setResizable(false);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
//		this.getContentPane().setBackground(Color.blue);
		this.setBounds(220,50,1440,900);
		this.setVisible(true);
		this.repaint();
		this.setTitle("   EastEatsFlower");
	}
	
	public void paint(Graphics g)
	{
		
		if(RefreshCMD.getRefreshCMD().getGameState() != 0)
		{
//			this.createBufferStrategy(2);
//			BufferStrategy buffer = this.getBufferStrategy();
//			super.paint(g);
//			Graphics2D g2 = (Graphics2D)g;
//			MapCMD.getMapCMD().drawBackImage(g2);
//			RoleCMD.getRoleCMD().draw(g2);
//			MapCMD.getMapCMD().drawBalkImage(g2);
//			AiCMD.getAiCMD().dispose();
//			InfoCMD.getInfoCMD().draw(g2);
//			buffer.show();
			
		}else 
		{
			super.paint(g);
//			OutFrame.getOutFrame().createBufferStrategy(2);
		}
	}
	

}
